<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/template.xhtml">
	<ui:define name="bodyFrms">
		<script type="text/javascript">
         /* function to display file name when selected */
         $.fn.fileName = function() {
            var $this = $(this),
            $val = $this.val(),
            valArray = $val.split('\\'),
            newVal = valArray[valArray.length-1],
            $button = $this.siblings('.customfile-feedback');
            if(newVal !== '') {
               //alert(newVal.substring(0,30));
               if(newVal.length > 25){
              	 newVal = newVal.substring(0,22) + '...';
               }
               $button.text(newVal);
            }
         };
         
         $().ready(function() {
            /* on change, focus or click call function fileName */
            $('input[type=file]').bind('change focus click', function() {$(this).fileName()});
         });
      </script>

		<p>
			<h:outputFormat value="#{kullanicibundle.sayfa_aciklama}" />
			<br />
			<h:outputFormat value="#{kullanicibundle.sayfa_aciklama2}">
				<f:param value="#{kullaniciGuncelleBean.defaultSifre}" />
			</h:outputFormat>
		</p>

		<h:form enctype="multipart/form-data" id="bodyForm2">

			<p:panel header="#{kullanicibundle.giris_panel_header}"
				id="bilgiGirisPanel" styleClass="marginTop15">
				<h:outputScript library="js" name="document_ready.js" />
				<p:panelGrid columns="2" styleClass="zebra"
					columnClasses="confirmCol1,confirmCol2">
					<p:column>
						<h:outputText value="#{kullanicibundle.lbl_resim}" />
					</p:column>
					<p:column>
						<div>
							<div class="customfile" style="float: left">
								<div class="customfile-button"></div>
								<span class="customfile-feedback">#{kullanicibundle.lbl_resim_seciniz}</span>
								<p:fileUpload styleClass="customfile-input"
									value="#{kullaniciGuncelleBean.file}" mode="simple"
									sizeLimit="100000" allowTypes="/(\.|\/)(jpg|png|jpeg|gif)$/"
									style="right:0; top: 0;" />
							</div>
						</div>
					</p:column>
					<h:outputText value="#{kullanicibundle.lbl_ad}" />
					<p:inputText value="#{kullaniciGuncelleBean.ad}"
						styleClass="inputW" />
					<h:outputText value="#{kullanicibundle.lbl_soyad}" />
					<p:inputText value="#{kullaniciGuncelleBean.soyad}"
						styleClass="inputW" />
					<h:outputText value="#{kullanicibundle.lbl_mail}*" />
					<p:inputText id="mail" value="#{kullaniciGuncelleBean.mail}"
						styleClass="inputW" />
					<h:outputText rendered="#{kullaniciGuncelleBean.firstLogin}"
						value="#{kullanicibundle.lbl_sifre}*" />
					<p:password rendered="#{kullaniciGuncelleBean.firstLogin}" feedback="true"
						value="#{kullaniciGuncelleBean.sifre}"
						styleClass="inputW" autocomplete="off"
						label="#{kullanicibundle.lbl_yeni_sifre}"
						promptLabel="#{kullanicibundle.lbl_yeni_sifre_prompt}"
						weakLabel="#{kullanicibundle.lbl_sifre_weak}"
						goodLabel="#{kullanicibundle.lbl_sifre_good}"
						strongLabel="#{kullanicibundle.lbl_sifre_strong}" />
					<h:outputText value="#{kullanicibundle.lbl_rol}*" />
					<p:selectOneMenu id="role" value="#{kullaniciGuncelleBean.roleId}"
						style="width:207px">
						<f:selectItem itemLabel="#{appbundle.lbl_seciniz}" itemValue="" />
						<f:selectItems value="#{kullaniciGuncelleBean.roles}" />
					</p:selectOneMenu>
					<h:outputText value="#{kullanicibundle.lbl_durum}*" />
					<p:selectOneRadio value="#{kullaniciGuncelleBean.durum}"
						styleClass="ignoreZebra">
						<f:selectItem itemLabel="#{appbundle.lbl_aktif}"
							itemValue="#{true}" />
						<f:selectItem itemLabel="#{appbundle.lbl_pasif}"
							itemValue="#{false}" />
					</p:selectOneRadio>
				</p:panelGrid>
			</p:panel>
			<p>
				<h:outputFormat value="#{appbundle.zorunlu_alan_aciklama}" />
			</p>

			<h:panelGroup id="buttonsPanel">
				<div class="btnRightCol marginTop7">
					<p:commandButton value="#{appbundle.btn_iptal}"
						action="#{roleBean.cancelAction()}"
						update=":bodyForm2:bilgiGirisPanel" styleClass="btn100" />
					<p:commandButton value="#{appbundle.btn_tamam}" ajax="false"
						action="#{kullaniciGuncelleBean.saveAction()}" update="@form"
						styleClass="btn100" />
				</div>
			</h:panelGroup>
		</h:form>
	</ui:define>
</ui:composition>
</html>
